﻿package com.moonshineproject.text.change 
{
	
	public class TextChangeInsert extends TextChangeBase
	{
		private var _textLines:Vector.<String>;
		
		public function get textLines():Vector.<String>	{ return _textLines; }
		
		public function TextChangeInsert(startLine:int, startChar:int, textLines:Vector.<String>)
		{
			super(TextChangeBase.UNBLOCK);
			
			_startLine = startLine;
			_startChar = startChar;
			_textLines = textLines;
		}
		
		public override function getReverse():TextChangeBase
		{
			var endLine:int = startLine + textLines.length - 1;
			var endChar:int = (textLines.length == 1 ? startChar : 0) + textLines[textLines.length - 1].length;
			
			return new TextChangeRemove(startLine, startChar, endLine, endChar);
		}
		
	}

}